package com.zlt.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 读取prperties文件的工具类
 * @author kinglee
 *
 */
public class PropertiesUtil {

	private Properties properties;

	public PropertiesUtil(String path) throws IOException {
		super();
		InputStream is = PropertiesUtil.class.getClassLoader().getResourceAsStream(path);
		properties = new Properties();
		properties.load(is);
	}
	
	/**
	 * 获取properties文件对应的值
	 * @param key
	 * @return
	 */
	public String getProperty(String key) {
		return properties.getProperty(key);
	}
	
}
